package com.example.study.plus.mybatis_plus.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 角色对权限 中间表
 * </p>
 *
 * @author 路飞4
 * @since 2023-04-15
 */
@Getter
@Setter
@TableName("role_permission")
@ApiModel(value = "RolePermission对象", description = "角色对权限 中间表")
public class RolePermission implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("对应角色表")
    @TableField("role_id")
    private Long roleId;

    @ApiModelProperty("对应权限表")
    @TableField("permission_id")
    private Long permissionId;

    @ApiModelProperty("逻辑删除")
    @TableField("deleted")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty("创建时间")
    @TableField(value = "createTime", fill = FieldFill.INSERT)
    private String createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "updateTime", fill = FieldFill.INSERT_UPDATE)
    private String updateTime;

    @ApiModelProperty("乐观锁，使用时每次修改数据+1")
    @TableField("version")
    @Version
    private Integer version;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
}
